﻿using EnetaMvc.Core.Domain.Content;
using EnetaMvc.Core.Repositories;
using EnetaMvc.Infrastructure;
using NHibernate;

namespace EnetaMvc.Data.NHibernate.Repositories
{
    public class CommentRepository : BaseRepository, ICommentRepository
    {
        private readonly ISession _session;

        public CommentRepository(IMapperSession session) : base(((NHSession)session).GetCurrentSession())
        {
            _session = ((NHSession)session).GetCurrentSession();
        }

        public void Save(Comment comment)
        {
            if (comment == null)
                return;

            SaveInTransaction(comment);
        }
    }
}
